
package com.x52im.rbchat.logic.chat_group.impl;

import android.app.Activity;
import android.widget.FrameLayout;

import com.eva.android.widget.SimpleGridView;
import com.x52im.rbchat.R;
import com.x52im.rbchat.logic.chat_root.impl.AbstractMoreUIWrapper;

import java.util.ArrayList;

/**
 * 世界频道聊天界面中的更多功能面板封装类。
 * <p>
 * 本类中提取并封装了更多功能面板的gridview UI实现、事件调
 * 用等，防止BBSChatActivity中代码越来越多，而让维护变的困难，
 * 仅此而已。
 *
 * @author Jack Jiang(http://www.52im.net/space-uid-1.html)
 * @since 6.0
 */
public abstract class GroupChattingMoreUIWrapperX extends AbstractMoreUIWrapper
{
    public final static int MORE_ACTION_ID_IMAGE = 1;
    public final static int MORE_ACTION_ID_PHOTO = 2;
    public final static int MORE_ACTION_ID_FILE = 3;
    public final static int MORE_ACTION_ID_SHORTVIDEO = 4;
    public final static int MORE_ACTION_ID_LOCATION = 6;
    public final static int MORE_ACTION_ID_CONTACT_FRIEND = 7;
    public final static int MORE_ACTION_ID_CONTACT_GROUP = 8;
    public final static int MORE_ACTION_ID_AT = 9;

    public GroupChattingMoreUIWrapperX(final Activity context, final FrameLayout layoutbottomContent)
    {
        super(context, layoutbottomContent);
    }

    @Override
    protected ArrayList<SimpleGridView.DefaultElementDTO> createChatFunctionsData()
    {
        ArrayList<SimpleGridView.DefaultElementDTO> chatFuntionsData = new ArrayList<SimpleGridView.DefaultElementDTO>();
        chatFuntionsData.add(new SimpleGridView.DefaultElementDTO(
                createChatFunctionsAction(parentActivity, MORE_ACTION_ID_IMAGE), "照片"
                , parentActivity.getResources().getDrawable(R.drawable.chat_plus_func_image_selector)));
        chatFuntionsData.add(new SimpleGridView.DefaultElementDTO(
                createChatFunctionsAction(parentActivity, MORE_ACTION_ID_PHOTO), "拍照"
                , parentActivity.getResources().getDrawable(R.drawable.chat_plus_func_photo_selector)));

//		// 世界频道默认不开放大文件、短视频消息，但如果要开放的话，解除本判断即可
//		if(!isForBBS())
        {
            chatFuntionsData.add(new SimpleGridView.DefaultElementDTO(
                    createChatFunctionsAction(parentActivity, MORE_ACTION_ID_FILE), "大文件"
                    , parentActivity.getResources().getDrawable(R.drawable.chat_plus_func_file_selector)));
            chatFuntionsData.add(new SimpleGridView.DefaultElementDTO(
                    createChatFunctionsAction(parentActivity, MORE_ACTION_ID_SHORTVIDEO), "短视频"
                    , parentActivity.getResources().getDrawable(R.drawable.chat_plus_func_shortvideo_selector)));

            chatFuntionsData.add(new SimpleGridView.DefaultElementDTO(
                    createChatFunctionsAction(parentActivity, MORE_ACTION_ID_LOCATION), "位置"
                    , parentActivity.getResources().getDrawable(R.drawable.chat_plus_func_location_selector)));
            chatFuntionsData.add(new SimpleGridView.DefaultElementDTO(
                    createChatFunctionsAction(parentActivity, MORE_ACTION_ID_CONTACT_FRIEND), "个人名片"
                    , parentActivity.getResources().getDrawable(R.drawable.chat_plus_func_contact_selector)));
            chatFuntionsData.add(new SimpleGridView.DefaultElementDTO(
                    createChatFunctionsAction(parentActivity, MORE_ACTION_ID_CONTACT_GROUP), "群名片"
                    , parentActivity.getResources().getDrawable(R.drawable.chat_plus_func_contact2_selector)));

            if(!isForBBS()) {
                chatFuntionsData.add(new SimpleGridView.DefaultElementDTO(
                        createChatFunctionsAction(parentActivity, MORE_ACTION_ID_AT), "@某人"
                        , parentActivity.getResources().getDrawable(R.drawable.chat_plus_func_at_selector)));
            }
        }

        return chatFuntionsData;
    }

    protected boolean isForBBS()
    {
        return false;
    }

}
